#include <bits/stdc++.h>
using namespace std;

float a;
char b;

int solve(float a, char b) {
    int res = 0;
    if(b == 'y') res += 5;
    float remain = a - 1;
    res += 20;
    if(remain <= 0) return res;
    
    res += remain;
    if(floor(remain) != remain) res += 1;
    return res;
}
int main() {
    cin >> a >> b;
    cout << solve(a, b) << endl;
    return 0;
}
